home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / GLUT-3.7 / LIB / GLSMAP / smap_render.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-12  |  724 b   |  27 lines

  1.  
  2. /* Copyright (c) Mark J. Kilgard, 1998.  */
  3.  
  4. /* This program is freely distributable without licensing fees
  5.    and is provided without guarantee or warrantee expressed or
  6.    implied. This program is -not- in the public domain. */
  7.  
  8. #include <GL/glsmap.h>
  9. #include <GL/glu.h>
  10.  
  11. #include "glsmapint.h"
  12.  
  13. #if defined(GL_EXT_texture_object) && !defined(GL_VERSION_1_1)
  14. #define glBindTexture(A,B)     glBindTextureEXT(A,B)
  15. #endif
  16.  
  17. void
  18. smapRenderSphereMappedObj(SphereMap *smap)
  19. {
  20.         glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
  21.     glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
  22.     glEnable(GL_TEXTURE_GEN_S);
  23.     glEnable(GL_TEXTURE_GEN_T);
  24.     glEnable(GL_TEXTURE_2D);
  25.     glBindTexture(GL_TEXTURE_2D, smap->smapTexObj);
  26. }
  27.